package com.crocodileQ.controller;

import com.crocodileQ.common.R;
import com.crocodileQ.service.UploadService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author 鳄鱼杆
 */
@Slf4j
@RestController
public class UploadController {

    @Autowired
    private UploadService uploadService;

    /**
     * 上传图片
     * @param img
     * @return
     */
    @PostMapping("/upload")
    public R uploadImg(MultipartFile img){

        return uploadService.uploadImg(img);
    }
}
